package com.gufe.controller.admin.datascreen;

import com.gufe.result.Result;
import com.gufe.service.admin.datascreen.RightChartService;
import com.gufe.vo.datascreen.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/admin/data-screen")
@Slf4j
public class RightChartController {

    @Autowired
    private RightChartService rightChartService;

    // 获取数据大屏右上角数据
    @GetMapping("/right-top")
    public Result getRightTopData() {
        log.info("获取右上图表数据");
        List<RightTopDataVO> rightTopData = rightChartService.getRightTopData();
        return Result.success(rightTopData);
    }

    // 获取数据大屏右中数据
    @GetMapping("/right-center")
    public Result getRightCenterData(@RequestParam Integer gender) {
        log.info("获取右中图表数据");
        List<RightCenterDataVO> rightCenterData = rightChartService.getRightCenterData(gender);
        return Result.success(rightCenterData);
    }

    // 获取数据大屏右中大图数据
    @GetMapping("/right-center-main")
    public Result getRightCenterMainData() {
        log.info("获取右中大图数据");
        List<RightCenterDataMainVO> rightCenterMainData = rightChartService.getRightCenterMainData();
        return Result.success(rightCenterMainData);
    }




    // 获取数据大屏右下角数据
    @GetMapping("/right-bottom")
    public Result getRightBottomData() {
        log.info("获取右下角图表数据");
        List<RightBottomDataVO> rightBottomData = rightChartService.getRightBottomData();
        return Result.success(rightBottomData);
    }


    // 获取数据大屏右下角大图数据
    @GetMapping("/right-bottom-main")
    public Result getRightBottomMainData() {
        log.info("获取右下角大图数据");
        List<RightBottomMainDataVO> rightBottomMainData = rightChartService.getRightBottomMainData();
        return Result.success(rightBottomMainData);
    }



}
